/*
 * =====================================================================================
 *    Description:  use dp or dfs to solve the problem of deviding marbles
 *        Version:  1.0
 *        Created:  09/13/2012 07:38:16 PM
 * =====================================================================================
 */
#include	<stdio.h>
#include	<string.h>


#define	CLEAR(x, n) memset((x), 0x00,(n))
#define	REPEAT(b, n) for (int i = (b); i < (n); ++i)

static int valueCount[8];
//from 1 to 6
int stateMap[8][60004];
int evenValue;
int sum[8];

int searchAns(int idx, int mbValue)
{
    if (stateMap[idx][mbValue] != 0)
        return stateMap[idx][mbValue];
	
    int res = -1;

    int remain = mbValue - sum[idx-1];
	if (remain == 0)
		return 1;
	else if (remain < 0)
	    remain  = 0;
    int l = remain / idx;
    if (remain % idx)
        ++l;
    if (l > valueCount[idx])
    {
        stateMap[idx][mbValue] = -1;
        return -1;
    }
        
    int h = mbValue / idx;
    if (h > valueCount[idx])
        h = valueCount[idx];
    REPEAT(l, h+1)
    {
       // if (mbValue < i * idx)
           // break;
        res = searchAns(idx-1, mbValue - i * idx);
        if (res == 1)
            break;
    }
    stateMap[idx][mbValue] = res;
    //printf ( "state[%d][%d]=%d\n", idx, mbValue, res);
    return res;
}

static inline void init()
{
    //CLEAR(stateMap, sizeof(stateMap));
    for (int i = 1; i <= 6; ++i)
    {
        memset(stateMap[i], 0x00, sizeof(int) * (evenValue+1));
        for (int k = 0; k <= valueCount[i]; ++k)
            stateMap[i][k * i] = 1;
    }
    stateMap[0][0] = 1;
    for (int i = 1; i <= evenValue; ++i)
        stateMap[0][i] = -1;
}

int main(int argc, char *argv[])
{
    int collectionNo = 0;
    while (1) {
        evenValue = 0;
        valueCount[0] = 0;
        ++collectionNo;
        sum[0] = 0;
        for (int i = 1; i < 7; ++i)
        {
            scanf("%d", &valueCount[i]);
            evenValue += valueCount[i] * i;
            sum[i] = sum[i-1] + valueCount[i] * i;
        }
        if (evenValue == 0)
            break;
		//if (collectionNo != 1)
			//printf ( "\n" );
        int res = -1;
        if (evenValue % 2 == 0)
        {
            evenValue /= 2;
            //printf ( "evenvalue is %d\n", evenValue);
            init();
            res = searchAns(6, evenValue);
        }
        if (res == -1)
        {
            printf ( "Collection #%d:\n", collectionNo);
            printf ( "Can't be divided.\n" );
        }
        else 
        {
            printf ( "Collection #%d:\n", collectionNo);
            printf ( "Can be divided.\n" );
        }
        printf ( "\n" );
    }
    return 0;
}
